<%@ include file="/common/taglibs.jsp"%>

<head>
<title><fmt:message key="copyrightApplicationList.title" /></title>
<meta name="menu" content="CopyrightApplicationMenu" />
</head>

<div class="span9">
	<h2>
		<fmt:message key="copyrightApplicationList.heading" />
	</h2>
	<security:authorize ifAllGranted="ROLE_ADMIN">
		<form method="post" action="${ctx}/copyrightApplications"
			id="searchForm" class="form-search">
			<div id="search" class="input-append">
				<input type="text" size="20" name="q" id="query" value="<s:property value="query"/>"
					placeholder="<fmt:message key="search.enterTerms"/>"
					class="input-medium search-query" />
				<button id="button.search" class="btn" type="submit">
					<i class="icon-search"></i>
					<fmt:message key="button.search" />
				</button>
			</div>
		</form>
	</security:authorize>

	<%-- <fmt:message key="copyrightApplicationList.message" /> --%>

	<security:authorize ifAllGranted="ROLE_USER">
		<div id="actions" class="form-actions">
			<a class="btn btn-primary"
				href="<c:url value='/editCopyrightApplication'/>"> <i
				class="icon-plus icon-white"></i> <fmt:message key="button.add" />
			</a><%--  <a class="btn" href="<c:url value="/mainMenu"/>"> <i
				class="icon-ok"></i> <fmt:message key="button.done" />
			</a> --%>
		</div>
	</security:authorize>

	<display:table name="copyrightApplications"
		class="table table-condensed table-striped table-hover" requestURI="" export="false"
		id="copyrightApplicationList" pagesize="25">
		<display:column property="id" sortable="true"
			href="editCopyrightApplication" media="html" paramId="id"
			paramProperty="id" titleKey="copyrightApplication.id" />
		<display:column property="name1" sortable="true"
			titleKey="copyrightApplication.name1" />
		<display:column property="softFullName" sortable="true"
			titleKey="copyrightApplication.softFullName" />
		<display:column property="editionNumber" sortable="true"
			titleKey="copyrightApplication.editionNumber" />
		<display:column sortable="true" titleKey="copyrightApplication.state">
			<c:if test="${copyrightApplicationList.state == 1}">
				<fmt:message key="state.notReviewed" />
			</c:if>
			<c:if test="${copyrightApplicationList.state == 2}">
				<fmt:message key="state.passed" />
			</c:if>
			<c:if test="${copyrightApplicationList.state == 4}">
				<fmt:message key="state.notPassed" />
			</c:if>
		</display:column>

		<security:authorize ifAllGranted="ROLE_ADMIN">
			<display:column titleKey="operate.title">
				<c:if test="${copyrightApplicationList.state == 1}">
					<a class="btn btn-link"
						href="<c:url value='/editCopyrightApplication'><c:param name="id" value="${copyrightApplicationList.id}"/></c:url>">
						<fmt:message key="operate.review" />
					</a>
				</c:if>

			</display:column>
		</security:authorize>

		<display:setProperty name="paging.banner.item_name" value="">
			<%-- <fmt:message key="copyrightApplicationList.copyrightApplication" /> --%>
		</display:setProperty>
		<display:setProperty name="paging.banner.items_name" value="">
			<%-- <fmt:message key="copyrightApplicationList.copyrightApplications" /> --%>
		</display:setProperty>

		<display:setProperty name="export.excel.filename">
			<fmt:message key="copyrightApplicationList.title" />.xls</display:setProperty>
		<display:setProperty name="export.csv.filename">
			<fmt:message key="copyrightApplicationList.title" />.csv</display:setProperty>
		<display:setProperty name="export.pdf.filename">
			<fmt:message key="copyrightApplicationList.title" />.pdf</display:setProperty>
	</display:table>
</div>

<script type="text/javascript">
	$(document).ready(function() {
		$("#copyrightApplicationList").children('thead').find('th').css({"background-color":"#d9edf7","text-align":"center","white-space":"nowrap"});
		$("#copyrightApplicationList").children('tbody').find('td').css({"text-align":"center","white-space":"nowrap"});
			
	});
</script>
